package com.car.dal.dao.grade;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgUsergrade;
import com.car.util.Page;

public class TgUsergradeDaoImpl extends IbatisCommonDao<TgUsergrade, Long> implements TgUsergradeDao {

	public GridObj GetList(TgUsergrade usergrade, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("desc");
		order.setSort("createdate");
		// TODO Auto-generated method stub
		return super.findByPage(usergrade, pageObj, order);
	}

	@Override
	public List<TgUsergrade> getTgUsergrade(TgUsergrade usergrade) {
		List<TgUsergrade> list=this.queryForEntityList(TgUsergrade.class,"getTgUsergrade", usergrade);
		return list;
	}
	
	public Integer getUsergradeCount(TgUsergrade usergrade) {
		return this.queryForInteger("getUsergradeCount", usergrade);
	}
	
	public List<TgUsergrade> getUsergradelist(TgUsergrade usergrade , Page page) {
		usergrade.setFirstrownum(page.getFirstrownum());
		usergrade.setPagesize(page.getPagesize());
		List<TgUsergrade> list=this.queryForEntityList(TgUsergrade.class,"getUsergradelist", usergrade);
		return list;
	}

	@Override
	public List<TgUsergrade> getTgUsergrade2(TgUsergrade usergrade) {
		List<TgUsergrade> list=this.queryForEntityList(TgUsergrade.class,"getTgUsergradeavg", usergrade);
		return list;
	}

}
